import scrapy


class ssr1_spider(scrapy.Spider):
    name = 'ssr1'

    start_urls = [
        'https://ssr1.scrape.center/'
    ]

    def parse(self, response, **kwargs):
        data = response.xpath("//div[@class='el-card__body']")[0]
        yield {
            'title': data.xpath("//h2/text()").getall(),
            'categories': data.xpath("//div[@class='categories']").getall(),
            'country': data.xpath("//div[@class='m-v-sm info'][1]/span[1]/text()").getall(),
            'time': data.xpath("//div[@class='m-v-sm info'][1]/span[3]/text()").getall(),
            'date': data.xpath("//div[@class='m-v-sm info'][2]/span/text()").getall(),
            'score': data.xpath("//p[@class='score m-t-md m-b-n-sm']/text()").getall()
        }
        yield from response.follow_all(xpath="//a[@class='next']", callback=self.parse)
